import axios from '@/axios'
enum API {
    RESIDENT_GETALL = '/getResidentAll',
    RESIDENT_GETPAGE = '/getResidentPage',
    RESIDENT_GETKEYPAGE = '/SearchResidentKey',
    RESIDENT_UPDATEBYID = '/updataResidentById',
    RESIDENT_DELETEBYID = '/deleteResidentById',
    RESIDENT_DELETEMOREBYID = '/deleteResidentMoreById',
    RESIDENT_ADD = '/addResident',
    
}
// 获取所有居民信息
export const getResidentAllAPI = () => axios.get(API.RESIDENT_GETALL)
// 分页查询居民
export const getResidentPageAPI = (data: any) => axios.post(API.RESIDENT_GETPAGE, data)
// 指定key-value分页查询居民
export const getResidentKeyPageAPI = (data: any) => axios.post(API.RESIDENT_GETKEYPAGE, data)
// 根据id更新居民
export const UpdateResidentByIdAPI = (data: any) => axios.post(API.RESIDENT_UPDATEBYID, data)
// 根据id删除居民
export const DeleteResidentByIdAPI = (residentId: string) => axios.delete(`${API.RESIDENT_DELETEBYID}/${residentId}`)
// 根据id批量居民
export const DeleteResidentMoreByIdAPI = (ids: any) => axios.post(API.RESIDENT_DELETEMOREBYID, ids)
// 添加居民
export const AddResidentAPI = (data: any) => axios.post(API.RESIDENT_ADD, data)